﻿file(GLOB_RECURSE BAR_CODE_SOURCES ${CMAKE_SOURCE_DIR}/src/tools/barcode/*.*)
file(GLOB_RECURSE XCODE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/*.*)
list(APPEND XCODE_SOURCES ${BAR_CODE_SOURCES})
list(APPEND XCODE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/xCode.rc)

include(cmake/x_3rd_zint.cmake)
include(cmake/x_qt_deploy.cmake)
include(cmake/x_qt_linguist.cmake)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${X_BINS_DIR}/xCode)
include_directories(${CMAKE_SOURCE_DIR}/xapps/x)
qt_add_executable(xCode ${XCODE_SOURCES} ${X_COMMON_FILES})
target_link_libraries(xCode PRIVATE Qt::CorePrivate Qt::Svg Qt::Widgets)
target_link_libraries(xCode PRIVATE ${X_ZINT_LIBS})
x_deploy_qt(xCode)
x_generate_translations(xCode)

if(WIN32 AND MSVC)
  target_link_libraries(xCode PRIVATE Dwmapi)
elseif(LINUX)
  target_link_libraries(xCode PRIVATE dl)
endif()
